//导入路由模块
const userRouter = require('./4.创建路由模块.js')

const express = require('express')


const app = express()

//使用 app.use() 注册路由模块
app.use(userRouter)

//注册路由时，可以添加统一的访问前缀 '/api'
app.use('/api',userRouter)



app.listen(8848,()=>{
    console.log('app is running at http://127.0.0.1:8848');
})